package cn.yusei.teamTribe;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import cn.yusei.teamTribe.interceptor.CommonInterceptor;
import cn.yusei.teamTribe.interceptor.TokenAuthInterceptor;

@Configuration
@PropertySource(value={"classpath:setting.properties", "classpath:email.properties"}, encoding="utf-8")
@MapperScan(basePackages={"cn.yusei.teamTribe.dao"})
public class TeamTribeConfig extends WebMvcConfigurerAdapter {

	@Autowired
	TokenAuthInterceptor tokenAuthInterceptor;
	@Autowired
	CommonInterceptor commonInterceptor;
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(tokenAuthInterceptor);
		registry.addInterceptor(commonInterceptor);
	}
}
